﻿@{
	ViewBag.Title = "Details";
	Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
	layui.use(['jquery', 'form', 'laydate', 'common', 'optimizeSelectOption'], function () {
		var form = layui.form,
			$ = layui.$,
			common = layui.common;
		//权限字段
		common.authorizeFields('adminform');
		var Id = $.request("Id");
		$(function(){
			//反填信息
			 common.ajax({
					url: "/STZBManage/CBGUrl/GetFormJson",
					data: { id: Id },
					dataType: "json",
					async: false,
					success: function (data) {
						common.val('adminform',data); //赋值
						$('input[name="Open_State"][value="'+data.Open_State+'"]').prop('checked', true);
						form.render();
					}
				});
		});
		wcLoading.close();
		//监听提交
		form.on('submit(saveBtn)', function (data) {
				var postData = data.field;
				postData.Id=Id;
				common.submitForm({
					url: "/STZBManage/CBGUrl/SubmitForm",
					param: postData,
					success: function () {
						common.parentreload("data-search-btn");
					}
				})
			return false;
		});
	});
</script>
<body>
	<div class="layuimini-container ">
		<div class="layuimini-main">
			<div class="layui-form layuimini-form" lay-filter="adminform">
				<div class="layui-form-item layui-hide">
					<label class="layui-form-label required">藏宝阁Url</label>
					<div class="layui-input-block">
						<input type="text" id="Url" name="Url" maxlength="50" lay-verify="required" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item layui-hide">
					<label class="layui-form-label required">点开状态</label>
					<div class="layui-input-block">
						<input type="radio" name="Open_State" value="0" title="未点开" checked>
						<input type="radio" name="Open_State" value="1" title="已点开">
					</div>
				</div>
				<div class="layui-form-item layui-hide">
					<button class="layui-btn site-demo-active" lay-submit id="submit" lay-filter="saveBtn">确认保存</button>
				</div>
			</div>
		</div>
	</div>
</body>
